<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/chat.css" rel="stylesheet" type="text/css" />
        <script language="JavaScript" type="text/javascript" src="js/ui.js"></script>
        <script language="JavaScript" type="text/javascript" src="js/logic.js"></script>
        <script language="JavaScript" type="text/javascript" src="js/util.js"></script>
        <script language="JavaScript" type="text/javascript">
            function CheckKey(event) {
                if (event.keyCode != null && event.keyCode == 13) {
                    PageSendMsg();
                }
            }
            function PageLogin() {
                Login(document.getElementById("PageUserName").value,"kf");
            }
            function PageSetColor(obj) {
                MsgColor = obj.style.backgroundColor;
                document.getElementById("MsgContent").style.color = obj.style.backgroundColor;
            }
            function CreateOnlineuser(username) {
                objuser = document.getElementById("Users");
                usertmp = document.createElement("li");
                usertmp.innerHTML = username;
                objuser.appendChild(usertmp);
            }
            function PageSendMsg() {
                SendMsg(document.getElementById("MsgContent").value);
            }
            function PageAddMsg(author,msgcontent,color) {
                objmsg = document.getElementById("Msgs");
                msgtmp = document.createElement("li");
                mc = document.createElement("div");
                mc.id = "msgcontent";
                mc.style.color = color;
                mc.innerHTML = msgcontent;
                msgtmp.insertBefore(mc,msgtmp.firstChild);
                tm = document.createElement("div");
                tm.id = "time";
                tm.innerHTML = new Date().toString();
                msgtmp.insertBefore(tm, msgtmp.firstChild);
                at = document.createElement("div");
                at.id = "author";
                at.innerHTML = author;
                msgtmp.insertBefore(at, msgtmp.firstChild);
                objmsg.insertBefore(msgtmp, objmsg.firstChild);
                return true;
            }
        </script>
    </head>
    <body onclick="SleepWindow()">
        <div align="center" id="PageLogin">
            <input tabindex="0" type="text" id="PageUserName"/>
            <input type="button" onclick="PageLogin()" value="登录"/>
        </div>
        <div align="center">
            <div id="Main">
                <div id="Talk">
                    <div id="MsgArea">
                        <input  onkeydown="CheckKey(event)" type="text" id="MsgContent"/>
                    </div>
                    <div id="SendButton"><a onclick="PageSendMsg()" href="#">Send</a></div>
                    <div id="ColorPicker">
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:black;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Fuchsia;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Red;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Blue;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Maroon;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Purple;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Navy;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Teal;"></div>
                        <div onclick="PageSetColor(this)" class="colorpane" style="background-color:Olive;"></div>
                    </div>
                </div>
                <div id="Msgs">

                </div>
                <div id="Users">

                </div>
            </div>
        </div>
    </body>
</html>
